Skip to content

Conversation

t-nelson
Copy link

@t-nelson t-nelson commented Oct 10, 2025

Problem

we publish a bunch of crates from the monorepo that we have no desire to adhere to semver or in any way maintain a stable api. people use these crates anyway, then cry when we break them. See #8424

Summary of Changes

make consumers of unstable apis sign a contract

  • introduce a new crate feature agave-unstable-api
  • gate the entrypoint (lib.rs) of every crate on it
  • add it to every crate's default feature, to avoid breaking anyone today

NOTE: this is a ham-fisted first pass. it blankets every crate. even the ones that we do more or less intend to be consumed. i'm indifferent as to whether we want to try to make those determinations here, or wait 'til later. there's no time crunch until we're ready to cut v4.0.0. i'll merge this with rebase+merge strategy to pad my github metrics ease reverting the changes on any crates after the fact


when we branch v4.0, we will remove agave-unstable-api from default features, freeing us of our burden

closes #3724

@t-nelson t-nelson requested review from a team, joncinque and steviez October 10, 2025 06:33
@t-nelson t-nelson requested review from a team as code owners October 10, 2025 06:33
@t-nelson t-nelson changed the title introduce agave-unstable-api throughout the monorep introduce agave-unstable-api throughout the monorepo Oct 10, 2025
Copy link

mergify bot commented Oct 10, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/kit (example)

Thank you for keeping the RPC clients in sync with the server API @t-nelson.

Copy link

mergify bot commented Oct 10, 2025

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

Copy link

mergify bot commented Oct 10, 2025

For your information, the solana-zk-token-sdk is deprecated, and this
directory will be removed in a future version. Please take this in mind
when making modifications.

@t-nelson t-nelson force-pushed the aua branch 2 times, most recently from 66b599a to 3ced707 Compare October 10, 2025 19:47
Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple items and a couple nits, I don't feel too strongly about alphabetizing the features in feature lists

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.2%. Comparing base (5aac226) to head (40a4b0c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8424   +/-   ##
=======================================
  Coverage    83.2%    83.2%           
=======================================
  Files         839      839           
  Lines      367877   367875    -2     
=======================================
+ Hits       306122   306158   +36     
+ Misses      61755    61717   -38     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@t-nelson
Copy link
Author

Couple items and a couple nits, I don't feel too strongly about alphabetizing the features in feature lists

will address in a couple hours. some of these make me question our ci since, if we actually had coverage, there's no way it would be green right now 🤔

@steviez
Copy link

steviez commented Oct 10, 2025

Couple items and a couple nits, I don't feel too strongly about alphabetizing the features in feature lists

will address in a couple hours. some of these make me question our ci since, if we actually had coverage, there's no way it would be green right now 🤔

To confirm, you're not talking about alphabetizing right (that is seemingly a setting to be turned on if such a setting exists) ?

As for the other items - Looking at solana-turbine as an example, the callers are enabling the feature. Ie, see solana-core:

solana-turbine = { workspace = true, features = ["agave-unstable-api"] }

I'm guessing having stuff gated twice behind [cfg(feature = "agave-unstable-api")] isn't a compile error so I think we're good. Or, am I missing something else that you're concerned about ?

Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I might be missing something really obvious, but isn't this a breaking change for anyone using default-features = false on any crates currently?

Since every crate has #![cfg(feature = "agave-unstable-api")] at the top, it means that downstream users get nothing if agave-unstable-api is disabled.

We probably just want to add the crate feature to every Cargo.toml and that's it, no?

Edit: otherwise, we're just creating completely unnecessary churn for downstream people who will just blindly add agave-unstable-api to all of their agave deps

@t-nelson
Copy link
Author

Couple items and a couple nits, I don't feel too strongly about alphabetizing the features in feature lists

will address in a couple hours. some of these make me question our ci since, if we actually had coverage, there's no way it would be green right now 🤔

To confirm, you're not talking about alphabetizing right (that is seemingly a setting to be turned on if such a setting exists) ?

actually the svm rent-collector one. ci should have puked but i bet it just has zero coverage

@t-nelson
Copy link
Author

Sorry, I might be missing something really obvious, but isn't this a breaking change for anyone using default-features = false on any crates currently?

technically yes, but how many of those are there and they are using what we deem to be unstable api. is there a lower touch path here?

Since every crate has #![cfg(feature = "agave-unstable-api")] at the top, it means that downstream users get nothing if agave-unstable-api is disabled.

that is ultimately the desired effect. to anyone who comes to us about broken interfaces in these crates i want to be able to say, "what did you think that agave-unstable-api crate flag meant?"

We probably just want to add the crate feature to every Cargo.toml and that's it, no?

maybe?

Edit: otherwise, we're just creating completely unnecessary churn for downstream people who will just blindly add agave-unstable-api to all of their agave deps

downstream is invalid here. the point of the crate feature is to make them admit they're using unstable crates

@alexpyattaev
Copy link

It would appear that the following crates might break with default features disabled:

tokens/Cargo.toml
13:default = ["remote-wallet-hidraw"]

tpu-client/Cargo.toml
16:default = ["spinner"]

cargo-registry/Cargo.toml
16:default = ["remote-wallet-hidraw"]

tpu-client-next/Cargo.toml
16:default = ["log"]

stake-accounts/Cargo.toml
16:default = ["remote-wallet-hidraw"]

remote-wallet/Cargo.toml
16:default = ["linux-static-hidraw"]

programs/vote/Cargo.toml
20:default = ["metrics"]

cli/Cargo.toml
20:default = ["remote-wallet-hidraw"]

keygen/Cargo.toml
20:default = ["remote-wallet-hidraw"]

syscalls/Cargo.toml
16:default = ["metrics"]

programs/sbf/rust/panic/Cargo.toml
15:default = ["custom-panic"]

programs/sbf/rust/custom_heap/Cargo.toml
15:default = ["custom-heap"]

programs/bpf_loader/Cargo.toml
20:default = ["metrics"]

For the most part our crates do not have default features enabled=>amount of breakage would be limited. We could of course do what @t-nelson is proposing for those crates that do not have default-features, and what @joncinque for the rest.

@t-nelson
Copy link
Author

It would appear that the following crates might break with default features disabled:

tokens/Cargo.toml
13:default = ["remote-wallet-hidraw"]

tpu-client/Cargo.toml
16:default = ["spinner"]

cargo-registry/Cargo.toml
16:default = ["remote-wallet-hidraw"]

tpu-client-next/Cargo.toml
16:default = ["log"]

stake-accounts/Cargo.toml
16:default = ["remote-wallet-hidraw"]

remote-wallet/Cargo.toml
16:default = ["linux-static-hidraw"]

programs/vote/Cargo.toml
20:default = ["metrics"]

cli/Cargo.toml
20:default = ["remote-wallet-hidraw"]

keygen/Cargo.toml
20:default = ["remote-wallet-hidraw"]

syscalls/Cargo.toml
16:default = ["metrics"]

programs/sbf/rust/panic/Cargo.toml
15:default = ["custom-panic"]

programs/sbf/rust/custom_heap/Cargo.toml
15:default = ["custom-heap"]

programs/bpf_loader/Cargo.toml
20:default = ["metrics"]

For the most part our crates do not have default features enabled=>amount of breakage would be limited. We could of course do what @t-nelson is proposing for those crates that do not have default-features, and what @joncinque for the rest.

most of these are bin crates. all of the lib crates where there was a problem were caught by ci and corrected already. do you have a specific instances that needs corrected?

@t-nelson
Copy link
Author

Couple items and a couple nits, I don't feel too strongly about alphabetizing the features in feature lists

everything here is addressed now

@alexpyattaev
Copy link

most of these are bin crates. all of the lib crates where there was a problem were caught by ci and corrected already. do you have a specific instances that needs corrected?

No I think we're good, just copied the data here for the record.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregcusack do we want to blanket agave-unstable-api over gossip? I think it might be a bit overkill in this case as it is likely to be used externally.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the agave-unstable-api on by default? so end users shouldn't be affected? They can still use the gossip crate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, true, the point is we have hidden a bunch of unstable multihoming logic behind this flag, enabling it by default would allow external users to depend on that API

edition = { workspace = true }

[features]
default = ["agave-unstable-api"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We explicitly did not want to have turbine exposed at all as we intend to have breaking changes there. adding this to default features would undo that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole point of this change set is to give us free reign to break these interfaces. if something is gated by this crate feature, we tell anyone complaining about breakage to fuck off

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but right now turbine already has it disabled by default, and entirety of its API is invisible already since 3.0. No point exposing it again.

@alexpyattaev
Copy link

alexpyattaev commented Oct 13, 2025

I believe this PR may expose a bunch of things we have already hidden behind agave-unstable-api by making it a default feature, which is not ideal. Not sure if there is a good workaround for that.

@gregcusack
Copy link

I believe this PR may expose a bunch of things we have already hidden behind agave-unstable-api by making it a default feature, which is not ideal. Not sure if there is a good workaround for that.

oh yesssss i see what you are saying. true. if our original intent was "if you want to use multihoming, know it's all unstable". and now our intent is "if you want to use gossip, know it is all unstable". then i think we're generally fine since the multihoming stuff is kinda a subset of gossip stuff.

@t-nelson
Copy link
Author

ok this is updated as per comments on the issue. we have relaxed the initial behavior to throw a deprecation warning if the agave-unstable-api crate feature is not specified rather rug the symbols outright and specify the feature in default-features

any crates that had partially employed agave-unstable-api already now apply it to the entire crate interface

bin crates have now been dropped where convenient


there are at least two outstanding issues, which are that genesis and vortexor dirs specify two targets, one bin and one lib. initial search didn't reveal an obvious way to remove the default feature specification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we allow breaking changes to crate interfaces outside of major version bumps

6 participants